package com.pro.back.util;

import java.util.UUID;

/**
 * 生成随机数
 */
public class CodeUtil {

    /**
     * 生成10位随机码
     * @return
     */
    public static String random10Digit() {
        long randomLong = UUID.randomUUID().getLeastSignificantBits();
        String randomLongString = String.format("%10d", randomLong).replace(" ", "0");
        return randomLongString.substring(randomLongString.length() - 10);
    }

    /**
     * UUID
     * @return
     */
    public static String getUUID() {
        return UUID.randomUUID().toString().replace("-", "");
    }



}
